<script setup>
import {useTemplateRef} from "vue";
const rootEl = useTemplateRef("rootEl");

const onChange = () => {
  console.log(rootEl.value);
  rootEl.value
}
</script>

<template>
<div theme="theme-default" ref="rootEl">
  <button @click="onChange">切换</button>
  <h1>测试</h1>
</div>
</template>

<style scoped lang="less">
h1 {
  color: var(--text-color-default);
}
</style>
